Curve matching (Van Buuren 2014)
\[ \begin{align} D_M &= ((\vec{x} - \vec{y})' {\rm \bf C}^{-1} (\vec{x} - \vec{y}) )^{\frac{1}{2}},\\ D_F (f, g) &= \inf_{\alpha, \beta} \max_{t\in[0,1]} d(f(\alpha(t)), g(\beta(t))),\\ D_{LSML}(x_i, x_j) &= \sqrt{(x_i - x_j)^TWW^T(x_i - x_j)}.\\ \end{align} \]
SMOCK data (Herngreen et al. 1994)
We will need the following libraries:
library(mice) library(tidyverse) library(brokenstick) library(matlib) library(ggplot2) library(ggrepel) library(Rcpp) library(latex2exp) library(plotly)
p <- ggplot(donors, aes(x = predictive_distance,
y = MD, color = factor(pmm), shape = factor(md),
alpha = factor(all))) + scale_alpha_discrete(range = c(0.4,
1)) + geom_point(color = ifelse(donors$plotname %in%
matches_pmm, "red", "black")) + geom_point(data = donors %>%
filter(plotname %in% matches_blended),
pch = 21, size = 4, colour = "green") +
geom_label_repel(aes(label = three, segment.size = 0.1),
data = donors %>%
filter(three %in% matches_three),
min.segment.length = 0, label.padding = 0.1,
size = 2, max.overlaps = 20, color = "black") +
labs(x = TeX("Predictive Distance"),
y = TeX("Mahalanobis Distance"),
title = "Distance of each donor") +
theme(legend.position = "none")
Herngreen, W. P., S. Van Buuren, J. C. Van Wieringen, J. D. Reerink, S. P. Verloove-Vanhorick, and J. H. Ruys. 1994. “Growth in Length and Weight from Birth to 2 Years of a Representative Sample of Netherlands Children (Born in 1988–89) Related to Socioeconomic Status and Other Background Characteristics.” Annals of Human Biology 21 (5): 449–63. https://doi.org/10.1080/03014469400003472.
Van Buuren, Stef. 2014. “Curve Matching: A Data-Driven Technique to Improve Individual Prediction of Childhood Growth.” Annals of Nutrition and Metabolism 65 (2-3): 227–33. https://doi.org/10.1159/000365398.